package com.example.demo.intf;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import com.example.demo.bean.Result;
import com.example.demo.entity.LoginUser;
import com.example.demo.entity.UserFriend;
import com.example.demo.exception.SPIPException;

@FeignClient(value = "user-admin")
public interface UserInterface {
	/**
	 * add 好友
	 * 
	 * @param userFriend
	 * @return
	 * @throws SPIPException
	 */
	@PostMapping(value = "/user/addFriend")
	public Result addFriend(@RequestBody List<UserFriend> list) throws SPIPException;

	/**
	 * 根据手机号查找好友
	 * 
	 * @param userMobile
	 * @return
	 * @throws SPIPException
	 */
	@GetMapping(value = "/user/searchByMobile")
	public Result searchByMobile(@RequestParam("userMobile") String userMobile) throws SPIPException;

	/**
	 * 查询同步增量好友列表(userId,updateTime)
	 * 
	 * @param userFriend
	 * @return
	 * @throws SPIPException
	 */
	@PostMapping(value = "/user/queryFriendsInc")
	public Result queryFriendsInc(@RequestBody UserFriend userFriend) throws SPIPException;

	/**
	 * 修改用户信息
	 * 
	 * @return
	 * @throws SPIPException
	 */
	@PostMapping(value = "/user/update")
	public Result update(@RequestBody LoginUser loginUser) throws SPIPException;
}
